//
//  ZDHotlineController.m
//  TCProject
//
//  Created by admin on 16/2/3.
//  Copyright © 2016年 wise-wing. All rights reserved.
//

#import "ZDHotlineController.h"

@interface ZDHotlineController ()
@property (weak, nonatomic) IBOutlet UILabel *hotlineTextfield;

@end

@implementation ZDHotlineController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self getData];
}

- (void)getData
{
    BMRequest *request = [BMRequest requestWithPath:@"getConstantParam.htm"];
    [self showHudWithhint:kDefaultMessage];
    [[BMHttpTool sharedInstance] postWith:request finish:^(BMResponse *response, NSError *error) {
        [self hideHud];
        if (response.status == kResultOK) {
            self.hotlineTextfield.text = response.rawResult[@"param"][@"value"];
        } else {
            [self showHint:@"获取客服信息失败"];
        }
    }];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    [BMUtils callWithPhoneNumber:_hotlineTextfield.text];
}

@end
